package com.jj.web;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.time.ZoneOffset;

/**
 * Created by huangyuqiang on 2016/4/9.
 */
@RestController
@RequestMapping("/time")
public class DateTimeController {

    @RequestMapping(value = "/now", method = RequestMethod.GET)
    public Long now() {
        return LocalDateTime.now().toEpochSecond(ZoneOffset.UTC);
    }
}
